<?php
namespace app\web\model;

/**
 * @package app\basic\model
 */
class Category extends Common 
{
    public static function getAll($map)
    {
        $list = self::where($map)
                    ->order('sort desc,id desc')
                    ->field('id,category_name,category_type,position_name,image,url,project_technician')
                    ->all()->each(function($item,$key){
                        $item['position_name'] = $item['position_name'] ? explode(',',$item['position_name']) : [];
                        return $item;
                    });
        return $list;
    }
}
